pkgname=gruijieclient
pkgver=21
pkgrel=1
pkgdesc="RuijieClient的GUI前端"
arch=('i686' 'x86_64')
url="http://gruijieclient.googlecode.com"
license=('GPL3')
groups=()
depends=('ruijieclient' 'python')
makedepends=()
provides=("$pkgname=${pkgver}")
replaces=($pkgname)
backup=()
options=()
install=()
source=($pkgname.desktop)
noextract=()
md5sums=()

_svntrunk=http://gruijieclient.googlecode.com/svn/trunk
_svnmod=gruijieclient

build() {
  cd "$srcdir"

  if [ -d $_svnmod/.svn ]; then
    (cd $_svnmod && svn up -r $pkgver)
  else
    svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
  fi

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  cd "$srcdir/$_svnmod"

  install -D -m755 src/gruijieclient.py ${pkgdir}/usr/share/gruijieclient/gruijieclient.py
  install -d -m755 src/gruijieclient $pkgdir/usr/share/gruijieclient/gruijieclient
  cp -r src/gruijieclient/* $pkgdir/usr/share/gruijieclient/gruijieclient/
  rm -rf `find $pkgdir/usr/share/gruijieclient/gruijieclient -type d -name ".svn"`
  install -D -m 755 $srcdir/$pkgname.desktop $pkgdir/usr/share/applications/$pkgname.desktop
  sed -i "s#gruijieclient/glade/'#/usr/share/gruijieclient/gruijieclient/glade/'#g" $pkgdir/usr/share/gruijieclient/gruijieclient/globe.py
}
